<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
     <pre>
         #判断用户输入的两个单词是否字母相同且出现的次数也一样
         def is_anagram(str1,str2):
             list_str1 = list(str1)
             list_str1.sort()
             list_str2 = list(str2)
             list_str2.sort()

             return list_str1 == list_str2


         print(is_anagram("anagram","nagaram"))
         print(is_anagram('cat','rat'))

     </pre>
</body>
</html>